<?php

/**
 * Setting form base class.
 *
 * @method Setting getObject() Returns the current form's model object
 *
 * @package    billingSystem
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 29553 2010-05-20 14:33:00Z Kris.Wallsmith $
 */
abstract class BaseSettingForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'vendorname'  => new sfWidgetFormInputHidden(),
      'vendoremail' => new sfWidgetFormInputText(),
      'weeklydate'  => new sfWidgetFormChoice(array('choices' => array('Saturday' => 'Saturday', 'Sunday' => 'Sunday', 'Monday' => 'Monday', 'Tuesday' => 'Tuesday', 'Wednesday' => 'Wednesday', 'Thursday' => 'Thursday', 'Friday' => 'Friday'))),
      'monthlydate' => new sfWidgetFormInputText(),
      'graceperiod' => new sfWidgetFormInputText(),
      'created_at'  => new sfWidgetFormDateTime(),
      'updated_at'  => new sfWidgetFormDateTime(),
    ));

    $this->setValidators(array(
      'vendorname'  => new sfValidatorChoice(array('choices' => array($this->getObject()->get('vendorname')), 'empty_value' => $this->getObject()->get('vendorname'), 'required' => false)),
      'vendoremail' => new sfValidatorString(array('max_length' => 250)),
      'weeklydate'  => new sfValidatorChoice(array('choices' => array(0 => 'Saturday', 1 => 'Sunday', 2 => 'Monday', 3 => 'Tuesday', 4 => 'Wednesday', 5 => 'Thursday', 6 => 'Friday'))),
      'monthlydate' => new sfValidatorInteger(),
      'graceperiod' => new sfValidatorInteger(),
      'created_at'  => new sfValidatorDateTime(),
      'updated_at'  => new sfValidatorDateTime(),
    ));

    $this->widgetSchema->setNameFormat('setting[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'Setting';
  }

}
